State Reset Webhook
The following document outlines the details of the Application State Reset Webhook.
Overview
The State Reset webhook is triggered when a CPR state reset action is successfully executed.
The webhook notification is triggered under the following conditions:
- When one of the two state reset actions is successfully executed:
- either
clear_continuous_stateaction is performed: resets state from a specific module onward - or
clear_complete_stateaction is performed: resets the entire transaction state
- and, when the event(
APPLICATION_STATE_RESET) is subscribed to, for the respectiveappID.
Event Type
APPLICATION_STATE_RESET
To receive notifications, it is mandatory to subscribe to the APPLICATION_STATE_RESET webhook event. For subscription details, please refer to the Results Webhook documentation.
Webhook Payload
The following JSON code snippet demonstrates the Payload received from the State Reset Webhook:
{
"eventId": "<UUID>",
"eventType": "APPLICATION_STATE_RESET",
"eventTime": "<ISO_Timestamp>",
"appId": "<App_ID>",
"transactionId": "<Transaction_ID>",
"workflowId": "<Workflow_ID>",
"previousStatus": "<Previous_Status>",
"reviewerId": "<Reviewer_ID>",
"resetType": "<Reset_Type>",
"moduleId": "<Module_ID>"
}
Payload Details
The following table provides the details of the parameters returned in the State Reset Webhook's Payload:
| Parameter | Type | Description | Present for all instances? |
|---|---|---|---|
eventId | string | The unique UUID for this webhook event | Yes |
eventType | string | Always set to "APPLICATION_STATE_RESET" | Yes |
eventTime | string | The ISO timestamp when the event occurred | Yes |
appId | string | The App ID where the reset occurred | Yes |
transactionId | string | The Transaction ID that was reset | Yes |
workflowId | string | The Workflow ID associated with the transaction | Yes |
previousStatus | string | The status of the transaction before the reset | Yes |
reviewerId | string | The email of the user who performed the reset (or reviewer ID) | Yes |
resetType | string | The type of reset performed. See Reset Types for all possible values | Yes |
moduleId | string | The Module ID from which state was reset | No (only for continuous reset , i.e., when the resetType is "RESET_FROM_SPECIFIC_STEP") |
Reset Types
The following table lists all possible values for the resetType field in the State Reset webhook's payload:
resetType | Action | Description |
|---|---|---|
| RESET_FROM_SPECIFIC_STEP | clear_continuous_state | Resets state from a specific module onward. The moduleId field will be present in the payload. |
| COMPLETE_STATE_RESET | clear_complete_state | Clears the entire transaction state. The moduleId field will not be present in the payload. |
Example Payloads
The following are examples that visulaise the payload structures for the two resetTypes:
- Continuous State Reset
- Complete State Reset
{
"eventId": "<Event_ID>",
"eventType": "APPLICATION_STATE_RESET",
"eventTime": "2024-01-15T10:30:00.000Z",
"appId": "my-app-id",
"transactionId": "txn-12345",
"workflowId": "onboarding-workflow",
"previousStatus": "needs_review",
"reviewerId": "admin@company.com",
"resetType": "RESET_FROM_SPECIFIC_STEP",
"moduleId": "document-verification"
}
{
"eventId": "<Event_ID>",
"eventType": "APPLICATION_STATE_RESET",
"eventTime": "2024-01-15T10:35:00.000Z",
"appId": "my-app-id",
"transactionId": "txn-12345",
"workflowId": "onboarding-workflow",
"previousStatus": "needs_review",
"reviewerId": "admin@company.com",
"resetType": "COMPLETE_STATE_RESET"
}